package com.canaan.business.common.enums.inOutStock;

/**
 * 库存占用类型枚举
 */
public enum StockOccupyTypeEnum {
    OCCUPY("1", "库存占用"),
    LOCK("2", "盘库锁定"),
    FREEZE("3", "库存冻结"),
    WAIT_INSPECTION_FREEZE("4", "待检仓库存占用"),
    ;

    private final String code;
    private final String message;

    StockOccupyTypeEnum(String code, String info)
    {
        this.code = code;
        this.message = info;
    }

    public String getCode() {
        return code;
    }

    public String getMessage() {
        return message;
    }

    public static String getMessageByCode(String code){
        if(code == null){
            return null;
        }
        String message = null;
        for (StockOccupyTypeEnum value : values()) {
            if(value.getCode().equals(code)){
                message = value.getMessage();
                break;
            }
        }
        return message;
    }
}
